package chinaums.service.impl;

import chinaums.common.util.CfpsMQFactory;

import com.chinaums.ibmmq.MQ;
import com.chinaums.ibmmq.MQServer;
import com.chinaums.ibmmq.MQTopic;
/**
 * 
 * @author liyongjie
 * @time 2017年7月19日 下午3:32:21
 * @version v1.0
 * @description 发送话题工厂类
 */
public class CfpsMQFactorySendTopicImpl implements CfpsMQFactory {  
	private String hostName;
	private int port;
	private String queueManager;
	private String channel;
	private String topic;
	private String projectName;
	private String moduleName;
	public MQServer mqServer;
	public MQTopic mqTopic;
	
	/**
	 * 构造函数
	 */
	public CfpsMQFactorySendTopicImpl(String hostName, int port,
			String queueManager, String channel, String topic,
			String projectName, String moduleName) {
		super();
		this.hostName = hostName;
		this.port = port;
		this.queueManager = queueManager;
		this.channel = channel;
		this.topic = topic;
		this.projectName = projectName;
		this.moduleName = moduleName;
	}

	/**
	 * 创建目标话题
	 */
	@Override
	public MQ create() {
		mqServer = new MQServer(hostName, port, queueManager, channel);
		mqTopic = new MQTopic(mqServer, topic, projectName, moduleName);
		return mqTopic;
	}
	
	

}
